class_name PlayerStateChestControl
extends PlayerState

const DURACTION_CONTROL := 500
var time_since_control := Time.get_ticks_msec()

func _enter_tree() -> void:
	animation_player.play("chest_control")
	time_since_control = Time.get_ticks_msec()
	player.velocity = Vector2.ZERO
	
func _process(delta: float) -> void:
	if Time.get_ticks_msec() - time_since_control > DURACTION_CONTROL:
		transaction_state(Player.State.MOVING)

func can_pass() -> bool:
	return true
